<?php include view('header');?>

<?php if($uid){?>
<h1>编辑管理员权限 - <?php echo $a->v['username'];?></h1>
<?php }else{?>
<h1>添加新管理员</h1>
<?php }?>

<form action="system.php?action=editadmin" method="post">
<input type="hidden" id="a[uid]" name="a[uid]" value="<?php echo $a->v['uid'];?>" />
<table>
	<tr>
		<th><label>账号：</label></th>
		<td><input type="text" id="a[username]" name="a[username]" value="<?php echo $a->v['username']?>" /></td>
	</tr>
	<tr>
		<th><label>密码：</label></th>
		<td><input type="password" id="a[pw]" name="a[pw]" /></td>
	</tr>
	<tr>
		<th><label>再次确认密码：</label></th>
		<td><input type="password" id="a[pw2]" name="a[pw2]" /></td>
	</tr>
	<tr>
		<th><label>权限：</label></th>
		<td>
			<div class="spanlist">
				<span><?php echo Tpl::checkbox('p[addproject]', '添加新项目', $a->hasPermission('addproject'));?></span>
				<span><?php echo Tpl::checkbox('p[editproject]', '修改项目信息', $a->hasPermission('editproject'));?></span>
				<span><?php echo Tpl::checkbox('p[deleteproject]', '删除项目', $a->hasPermission('deleteproject'));?></span>
				<span><?php echo Tpl::checkbox('p[addprocess]', '添加项目进程', $a->hasPermission('addprocess'));?></span>
				<span><?php echo Tpl::checkbox('p[deleteprocess]', '删除项目进程', $a->hasPermission('deleteprocess'));?></span>
			</div>
		</td>
	</tr>
</table>
<button type="submit">确定<?php echo $uid ? '编辑' : '添加';?></button>
</form>

<?php include view('footer');?>